import Vue from 'vue'
import VueRouter from 'vue-router'
import HelloWorld from '../components/HelloWorld.vue' 
import Login from '../components/user/Login.vue'
import Management from '@/components/user/Management'
import Index from '@/components/user/Index'

Vue.use(VueRouter)

const routes = [
  {path:'/',redirect:'/login'},     //实现路由重定向
  {path:'/login',component:Login},
  {path:'/helloworld',component:HelloWorld},
  {path:'/management',component:Management},
  {path:'/index',component:Index}
]

const router = new VueRouter({
  //路由不跳转的解决方法，把mode改成history模式
  mode:'history',
  routes
})

export default router
